Favicon

You are here: Home > API Reference > Platform > Segment Role > Update segment role

Update segment role

Required Permission: base.organization.segmentRole.update

Update segment role

PUT
https://api.applivery.io/v1/organizations/{organizationId}/segment-roles/{roleId}
curl -X PUT "https://api.applivery.io/v1/organizations/{organizationId}/segment-roles/{roleId}" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "actions": [
    "string"
  ]
}'
const response = await fetch("https://api.applivery.io/v1/organizations/{organizationId}/segment-roles/{roleId}", {
  method: "PUT",
  headers: {
    Authorization: "Bearer <YOUR_API_KEY>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "string",
    "actions": [
      "string"
    ]
  }),
});

const data = await response.json();
import requests

response = requests.put(
    "https://api.applivery.io/v1/organizations/{organizationId}/segment-roles/{roleId}",
    headers={"Authorization": "Bearer <YOUR_API_KEY>"},
    json={
      "name": "string",
      "actions": [
        "string"
      ]
    },
)

data = response.json()

Request

Send your API key in the request header authorization
Example: Authorization: Bearer <token>

organizationId string
required
Match pattern: ^(([a-fA-F0-9]{24})|([a-zA-Z0-9\\-]{3,}))$
roleId string
required
Match pattern: ^[a-fA-F0-9]{24}$

Body Params application/json
name string optional
≤ 256 characters
actions array [string] optional
{
    "name": "string",
    "actions": [
        "string"
    ]
}

Responses

200 Response application/json
status boolean required
data object required
id string required
Match pattern: ^[a-fA-F0-9]{24}$
name string required
≤ 256 characters
slug string required
≤ 256 characters
actions array [string] required
{
    "status": true,
    "data": {
        "id": "string",
        "name": "string",
        "slug": "string",
        "actions": [
            "string"
        ]
    }
}
400 Response application/json
status boolean optional
false
error object optional
code number optional
5028
message string optional
Slug reserved
{
    "status": false,
    "error": {
        "code": 5209,
        "message": "Invalid input"
    }
}
401 Response application/json
status boolean optional
false
error object optional
code number optional
4004
message string optional
Invalid Token
{
    "status": false,
    "error": {
        "code": 4002,
        "message": "No auth token"
    }
}
404 Response application/json
status boolean optional
false
error object optional
code number optional
3001
message string optional
Entity not found
{
    "status": false,
    "error": {
        "code": 3001,
        "message": "Entity not found"
    }
}